<?php
/*! \brief
 * This is the Simple Factory Class that generate widget framework controller relative object
 * \author William Su
 */
class WFControllerFactory
{
    private static $instance;
    /**
     * @var WF
     */
    private $objFramework;
    public function __construct($objFramework){
        $this->objFramework = $objFramework;
    }
    /**
     * @return WFDbController
     */
    public function getDbController(){
        if(!isset(self::$instance[__FUNCTION__])){
            require dirname(__FILE__) . '/DbController.php';
            self::$instance[__FUNCTION__] = new WFDbController($this->objFramework);
        }
        return self::$instance[__FUNCTION__];
    }
}